home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / usr / share / xml2po / gs.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2007-04-29  |  2.7 KB  |  84 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.4)
  3.  
  4.  
  5. class gsXmlMode:
  6.     '''Abstract class for special handling of document types.'''
  7.     
  8.     def getIgnoredTags(self):
  9.         '''Returns array of tags to be ignored.'''
  10.         return [
  11.             'link',
  12.             'bug-stats',
  13.             'cvs-stats',
  14.             'unixname']
  15.  
  16.     
  17.     def getFinalTags(self):
  18.         """Returns array of tags to be considered 'final'."""
  19.         return [
  20.             'title',
  21.             'para',
  22.             'name',
  23.             'desc']
  24.  
  25.     
  26.     def getSpacePreserveTags(self):
  27.         '''Returns array of tags in which spaces are to be preserved.'''
  28.         return []
  29.  
  30.     
  31.     def getTreatedAttributes(self):
  32.         '''Returns array of tag attributes which content is to be translated'''
  33.         return []
  34.  
  35.     
  36.     def preProcessXml(self, doc, msg):
  37.         '''Preprocess a document and perhaps adds some messages.'''
  38.         pass
  39.  
  40.     
  41.     def _find_salute(self, node):
  42.         if node.name == 'salute':
  43.             return node
  44.         
  45.         child = node.children
  46.         while child:
  47.             ret = self._find_salute(child)
  48.             if ret:
  49.                 return ret
  50.             
  51.             child = child.next
  52.  
  53.     
  54.     def postProcessXmlTranslation(self, doc, language, translators):
  55.         '''Sets a language and translators in "doc" tree.
  56.         
  57.         "translators" is a string consisted of translator credits.
  58.         "language" is a simple string.
  59.         "doc" is a libxml2.xmlDoc instance.'''
  60.         if translators == self.getStringForTranslators():
  61.             return None
  62.         else:
  63.             salute = self._find_salute(doc.getRootElement())
  64.             if salute and salute.name == 'salute':
  65.                 salute.newChild(None, 'para', translators)
  66.             else:
  67.                 return None
  68.  
  69.     
  70.     def getStringForTranslators(self):
  71.         """Returns None or a string to be added to PO files.
  72.  
  73.         Common example is 'translator-credits'."""
  74.         return 'translator-credits'
  75.  
  76.     
  77.     def getCommentForTranslators(self):
  78.         '''Returns a comment to be added next to string for crediting translators.
  79.  
  80.         It should explain the format of the string provided by getStringForTranslators().'''
  81.         return 'Translators: enter a short paragraph creditting yourself and others who helped you with the translation.'
  82.  
  83.  
  84.